home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / EDITORS / COLORCTL.ZIP;1 / CDEFAULT.PRG next >
Encoding:
Text File  |  1991-10-30  |  1.9 KB  |  49 lines

  1. *      Program: CDEFAULT.PRG
  2. *       Author: George E. McMullen
  3. *             : Borland Technical Support
  4. *         Date: 10-18-91
  5. *     Function: Utilizes COLORCTL.BIN and COLOR.MEM (made from SETCLR.PRG)
  6. *               to set saved color settings.
  7. * Requirements: COLORCTL.BIN
  8. *               COLOR.MEM (made from SETCLR.PRG)
  9. *               VGA color monitor
  10.  
  11. * Setup Environment
  12. gl_escape=IIF(SET("ESCAPE")="ON","ON","OFF")
  13. SET ESCAPE OFF
  14. gl_talk=IIF(SET("TALK")="ON","ON","OFF")
  15. SET TALK OFF
  16. gl_echo=IIF(SET("ECHO")="ON","ON","OFF")
  17. SET ECHO OFF
  18. CLEAR                                  && Clear screen
  19.                                        && Check for colorctl.bin and color.mem
  20. IF .NOT. FILE("colorctl.bin") .OR. .NOT. FILE("color.mem")
  21.   IF .NOT. FILE("colorctl.bin")        && Couldn't find COLORCTL.BIN
  22.     ? CHR(7)+"Error: Could not locate COLORCTL.BIN"
  23.   ENDIF
  24.   IF .NOT. FILE("color.mem")           && Couldn't find COLOR.MEM
  25.     ? CHR(7)+"Error: Could not locate COLOR.MEM - Run SETCLR.PRG first."
  26.   ENDIF
  27.   SET ESCAPE &gl_escape                && Reset environment
  28.   SET ECHO &gl_echo
  29.   SET TALK &gl_talk
  30.   RETURN
  31. ENDIF
  32. LOAD colorctl.bin                      && Load COLORCTL.BIN
  33. RESTORE FROM color ADDITIVE            && Get saved colors (gl_color[16,4])
  34. pv_index=1
  35. pv_new_color=""                        && Set colorctl.bin command holder
  36. DO WHILE pv_index<17
  37.   pv_new_color='"Index='+STR(gl_colors[pv_index,1],2)+'",'+;
  38.                '"Red='  +STR(gl_colors[pv_index,2],2)+'",'+;
  39.                '"Green='+STR(gl_colors[pv_index,3],2)+'",'+;
  40.                '"Blue=' +STR(gl_colors[pv_index,4],2)+'"'
  41.   CALL colorctl WITH '/S',&pv_new_color  && Set new index color
  42.   pv_index=pv_index+1
  43. ENDDO
  44. RELEASE colorctl                     && Release COLORCTL.BIN from memory
  45. SET ESCAPE &gl_escape                && Reset environment
  46. SET ECHO &gl_echo
  47. SET TALK &gl_talk
  48. RETURN
  49.